#***************************************************************************************************************** # # AdoScript File of Industrial_Business_Process_Management_ADOxx15-v0.3.0 Application Library # # AdoScript for availability check of part/materials assigned to a 'Task' through a 'Material Join Gateway' # #------------------------- GENERAL FILE INFOS -------------------------------------------------------------------- # # APPLIES TO: Industrial Business Process Management Toolkit V:1.0 # FILE VERSION: 1.0 # AUTHOR: NEF (BOC AM) # #--------------------------- FILE DEPENDENCIES ------------------------------------------------------------------- # # INCLUDING FILES: None # # INCLUDED BY: None # #--------------------------- READ BEFORE EDIT -------------------------------------------------------------------- # # --- File History --- # # [NEF, 09.11.2017] # - initial version for Industrial Business Process Management Toolkit # # USAGE: The mechanism triggered by PROGRAMCALL type attribute 'Check availability' # through NOTEBOOK of selected 'Material Join Gateway' object. # # REMARKS: - Industrial_Business_Process_Management_ADOxx15-v0.3.0 Application Library is based # on StartingPoint_BPMN2-0_ADOxx1-3-UL1_v1-01.abl # (https://www.adoxx.org/svn/all-repo/4_StartingPoint_BPMN2.0_ADOxx13UL1/BIN/StartingPoint_BPMN2-0_ADOxx1-3-UL1_v1-01.abl) # provided by ADOxx.org. # #----------------------------------------------------------------------------------------------------------------- #***************************************************************************************************************** SET nCurrentObjID:(objid) CC "Core" GET_MODEL_ID objid:(nCurrentObjID) SET nCurrentModelID:(modelid) CC "Core" GET_OBJ_NAME objid: (nCurrentObjID) SETL sCurrentObjName:(objname) CC "Core" GET_CLASS_ID objid:(nCurrentObjID) SET nCurrentClassID:(classid) CC "Core" GET_CLASS_NAME classid:(nCurrentClassID) SET sCurrentClassName:(classname) CC "Core" GET_CLASS_ID classname: ("Parts flow") SET nRPartsFlowClassID:(classid) CC "AQL" EVAL_AQL_EXPRESSION expr: ("({\""+sCurrentObjName+"\" : \""+sCurrentClassName+"\"}<-\"Parts flow\")") modelid: (nCurrentModelID) SETL lPartsNodeList:(objids) SET bAvailabilityFlag:1 FOR sPartsNode in: (lPartsNodeList) { SET nPartsNode:(VAL sPartsNode) CC "Core" GET_OBJ_NAME objid: (nPartsNode) SETL sPartsNodeName:(objname) CC "Core" GET_ATTR_VAL objid:(nPartsNode) attrname: ("Available quantity") SET nAvailableQuantity:(val) CC "Core" GET_OBJ_ID modelid: (nCurrentModelID) classid: (nRPartsFlowClassID) objid1: (nPartsNode) objid2: (nCurrentObjID) SET nPartsFlowRelationID:(objid) CC "Core" GET_ATTR_VAL objid:(nPartsFlowRelationID) attrname:"Quantity" SET nRequiredQuantity:(val) IF (nAvailableQuantity < nRequiredQuantity) { CC "AdoScript" ERRORBOX ( "Part "+sPartsNodeName+" is not available in required amount") SET bAvailabilityFlag:0 CC "Core" SET_ATTR_VAL objid: (nPartsNode) attrname: ("Control Color") val: ("red") } } IF (bAvailabilityFlag = 1) { CC "AdoScript" INFOBOX ("All parts are available in required amount") }